package constant;

/**
 * Created by chenkuo on 2017/7/23.
 */
public enum WebCityId {


    bj("北京市", 1),
    tianjin("天津市",2),
    sjz("石家庄市", 3),
    tangshan("唐山市",4),
    taiyuan("太原市",5),

    jinzhongshi("晋中市",6),
    shenyang("沈阳市",7),
    dalianshi("大连市",8),
    changchunshi("长春市",9),
    haerbinshi("哈尔滨市",10),


    shanghaishi("上海市",11),
    nanjingshi("南京市",12),
    wuxishi("无锡市",13),
    suzhoushi("苏州市",14),
    hangzhoushi("杭州市",15),


    ningboshi("宁波市",16),
    wenzhoushi("温州市",17),
    jinhuashi("金华市",18),
    hefeishi("合肥市",19),
    fuzhoushi("福州市",20),


    xiamenshi("厦门市",21),
    jiujiangshi("九江市",22),
    jinanshi("济南市",23),
    qingdaoshi("青岛市",24),
    iboshi("淄博市",25),


    zhenghzoushi("郑州市",26),
    anyangshi("安阳市",27),
    wuhanshi("武汉市",28),
    changshashi("长沙市",29),
    guangzhoushi("广州市",30),


    shenzhenshi("深圳市",31),
    dongguanshi("东莞市",32),
    nanningshi("南宁市",33),
    chongqingshi("重庆市",34),
    chengdushi("成都市",35),

    luzhoushi("泸州市",36),
    leshanshi("乐山市",37),
    zunyishi("遵义市",38),
    kunmingshi("昆明市",39),
    xianshi("西安市",40),

    wulumuqishi("乌鲁木齐市",41),
    yilishi("伊犁市",42),;


    private String cityName;
    private Integer cityCode;

    WebCityId(String cityName, Integer cityCode) {
        this.cityName = cityName;
        this.cityCode = cityCode;
    }


    public static Integer getCityCodeByName(String cityName) {
        WebCityId[] values = WebCityId.values();
        for (int i = 0; i < values.length; i++) {
            if (values[i].cityName.equals(cityName)) {
                return values[i].cityCode;
            }
        }
        return null;
    }

}
